package cn.com.simple.learning.core.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.ToString;

import java.math.BigDecimal;

/**
 * @author Jianxing.Jia
 * @date 2022/5/29
 * @description 描述信息
 */
@ToString
@Data
@TableName("t_order")
public class Order {
    private Long id;
    private Long productId;
    private Long userId;
    private String productName;
    private BigDecimal price;

    public static Order from(Long id, Long productId, Long userId, String productName, BigDecimal price) {
        Order order = new Order();
        order.id = id;
        order.price = price;
        order.productId = productId;
        order.userId = userId;
        order.productName = productName;
        return order;
    }
    public static Order from(Long productId, Long userId, String productName, BigDecimal price) {
        Order order = new Order();
        order.price = price;
        order.productId = productId;
        order.userId = userId;
        order.productName = productName;
        return order;
    }
}
